using IQIGame.Onigao.Game;
using IQIGame.Onigao.GamePlay;

namespace IQIGame.Onigao.Logic
{
    /// <summary>
    /// 重置实体
    /// 参数组1： 1：实体tagOrMcid(0表示自己)
    /// </summary>
    public class ExecResetEntity : BaseServiceExecution
    {
        public override void Execute(LevelRegion region, LevelPlayer player)
        {
            var config = _config as ExecParamResetEntity;
            var entities = ListPool<LevelEntity>.Get();
            if (!LgLevelEntityUtil.GetEntitiesByDynCfgKeys(region, triggerEntity, config.tagOrMcid, entities, true))
            {
                ListPool<LevelEntity>.Put(entities);
                return;
            }

            region.ResetEntities(player, entities);

            ListPool<LevelEntity>.Put(entities);
        }
    }
}
